package com.google.gwt.it2tool.client.widget;

import com.google.gwt.it2tool.client.Production;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.Label;

public class MinuteWidget extends DockPanel {
	
	private final Production production;
	private final Label minutes;
	private final Label areaUp;
	private final Label areaDown;
	
	public MinuteWidget(Production prod){
		super();
		
		production = prod;
		int min = prod.getMins();
		minutes = new Label(Integer.toString(min));
		areaUp = new Label("↑"+Integer.toString(prod.getMinUpArea()));
		areaUp.setTitle("m² für "+ (min-1) +" Minuten");
		areaDown = new Label("↓"+Integer.toString(prod.getMinDownArea()));
		areaDown.setTitle("m² für "+ (min+1) +" Minuten");
		
		setHorizontalAlignment(DockPanel.ALIGN_RIGHT);
		setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
		setSpacing(1);
		
		
		this.add(minutes, DockPanel.WEST);
		this.add(areaUp, DockPanel.NORTH);
		this.add(areaDown, DockPanel.SOUTH);

		
		
		addStyleName("minutesWidget");
		minutes.addStyleName("minutesWidgetMinute");
		areaUp.addStyleName("minutesWidgetAreaUp");
		areaDown.addStyleName("minutesWidgetAreaDown");
	}

}
